package com.youshang520i.springnacosconfig;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.PostConstruct;

/**
 * 可以注册服务没办法读取配置，配置中心没有生效
 * @author youshang
 */
@RestController
@SpringBootApplication
public class SpringNacosConfigApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpringNacosConfigApplication.class,args);
    }

    @Value("${server.port}")
    public String port;

    @PostConstruct
    public void init(){
        System.out.println("port: " + port);
    }
}

